package com.xltt.vehicleControl.activity;


import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.xltt.vehicleControl.R;
import com.xltt.vehicleControl.base.BaseActivity;
import com.xltt.vehicleControl.fragment.VehicleFunctionFragment;
import com.xltt.vehicleControl.util.Logger;
import com.xltt.vehicleControl.view.SubmitButton;

import butterknife.BindView;
import butterknife.OnClick;

public class WindowsSettingsActivity extends BaseActivity {


    @BindView(R.id.windows_open_btn)
    SubmitButton mWindowsOpenBtn;
    @BindView(R.id.windows_close_btn)
    SubmitButton mWindowsCloseBtn;
    @BindView(R.id.windows_ventilation_btn)
    SubmitButton mWindowsVentilationBtn;

    public static final String VENLATION_MODE = "venlation_mode";


    @Override
    protected void initPresenter() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_windows_settings;
    }

    @Override
    protected void initViews() {

    }

    @OnClick({R.id.windows_open_btn,R.id.windows_close_btn,R.id.windows_ventilation_btn})
    public void onViewClicked(View view) {
        Intent mIntent = new Intent();
        if(view == mWindowsOpenBtn || view == mWindowsCloseBtn){
            mIntent.putExtra(VehicleFunctionFragment.COMMAND_PARAMETER,view == mWindowsOpenBtn ? "start" : "stop");
            setResult(VehicleFunctionFragment.WINDOWS_SETTINGS_RESULT_CODE,mIntent);
        }else if(view == mWindowsVentilationBtn){
            mIntent.putExtra(VehicleFunctionFragment.COMMAND_PARAMETER, VENLATION_MODE);
            setResult(VehicleFunctionFragment.WINDOWS_VENTILATION_RESULT_CODE,mIntent);
        }
        finish();

    }


}
